//
//  ViewController.m
//  MyDatePickerView
//
//  Created by hniisoft on 2018/9/11.
//  Copyright © 2018年 hniisoft. All rights reserved.
//

#import "ViewController.h"
#import "MyDateTimeView.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    [self setupView];
}

- (void)setupView{
    
    MyDateTimeView *dateView = [[MyDateTimeView alloc]initWithFrame:CGRectMake(40, 100, self.view.bounds.size.width - 80, 30)];
    dateView.pickerViewMode = MyDatePickerViewDateYearMonthDayHourMinuteSecondMode;
    [self.view addSubview:dateView];
    
    MyDateTimeView *dateView1 = [[MyDateTimeView alloc]initWithFrame:CGRectMake(40, 140, self.view.bounds.size.width - 80, 30)];
    dateView1.pickerViewMode = MyDatePickerViewDateYearMonthDayHourMinuteMode;
    [self.view addSubview:dateView1];
    
    MyDateTimeView *dateView2 = [[MyDateTimeView alloc]initWithFrame:CGRectMake(40, 180, self.view.bounds.size.width - 80, 30)];
    dateView2.pickerViewMode = MyDatePickerViewDateYearMonthDayHourMode;
    [self.view addSubview:dateView2];
    
    MyDateTimeView *dateView3 = [[MyDateTimeView alloc]initWithFrame:CGRectMake(40, 220, self.view.bounds.size.width - 80, 30)];
    dateView3.pickerViewMode = MyDatePickerViewDateYearMonthDayMode;
    [self.view addSubview:dateView3];
    
    MyDateTimeView *dateView4 = [[MyDateTimeView alloc]initWithFrame:CGRectMake(40, 260, self.view.bounds.size.width - 80, 30)];
    dateView4.pickerViewMode = MyDatePickerViewDateYearMonthMode;
    [self.view addSubview:dateView4];
    
    MyDateTimeView *dateView5 = [[MyDateTimeView alloc]initWithFrame:CGRectMake(40, 300, self.view.bounds.size.width - 80, 30)];
    dateView5.pickerViewMode = MyDatePickerViewDateYearMode;
    [self.view addSubview:dateView5];
    
    
}

- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
    [self.view endEditing:YES];
}
@end
